#ifndef WIDGET_FUNCF_CONTROL_MOTOR_H
#define WIDGET_FUNCF_CONTROL_MOTOR_H

#include <QWidget>
#include <QMouseEvent>
#include <QVector>

class Widget_funcF_Control_motor : public QWidget
{
    Q_OBJECT
public:
    explicit Widget_funcF_Control_motor(QWidget *parent = nullptr);
    
protected:
    void paintEvent(QPaintEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void leaveEvent(QEvent *event) override;
    void showWinDialog();
    void resetGame();

private:
    //Ui::Widget_funcF_Control_motor *ui;
    QVector<QVector<int>> board; // 棋盘状态
    QPoint lastPos;              // 最后落子位置
    bool isBlackTurn;            // 当前玩家
    QPoint hoverPos; // 声明成员变量
    //窗口图标
    QIcon * Window_icon;  

    void drawBoard(QPainter &painter);
    void drawPieces(QPainter &painter);
    bool checkWin(QPoint pos);
};


#endif // WIDGET_FUNCF_CONTROL_MOTOR_H
